<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace app\abnormalorder\model;

class OrderInfoHandle extends \app\BaseModel
{
    protected $name = "massage_service_abnormal_order_info_handle";
    public function dataAdd($data)
    {
        $data["create_time"] = time();
        $res = $this->insert($data);
        return $res;
    }
    public function dataUpdate($dis, $data)
    {
        $res = $this->where($dis)->update($data);
        return $res;
    }
    public function dataList($dis, $page)
    {
        $data = $this->where($dis)->order("id desc")->paginate($page)->toArray();
        return $data;
    }
    public function dataInfo($dis)
    {
        $data = $this->where($dis)->find();
        return !empty($data) ? $data->toArray() : [];
    }
    public function handleUserList($order_info_id)
    {
        $dis = ["order_info_id" => $order_info_id];
        $data = $this->alias("a")->join("shequshop_school_admin b", "a.user_id = b.id")->where($dis)->field("a.*,b.agent_name as user_name")->group("a.id")->select()->toArray();
        $role_model = new \app\node\model\RoleList();
        if(!empty($data)) {
            foreach ($data as &$v) {
                $v["handle_status"] = $v["status"];
                $v["role"] = $role_model->getUserRole($v["user_id"]);
            }
        }
        return $data;
    }
}

?>